Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use dynamic policy for PositionProvider reference in PositionService #5529

Merged

Conversation

nicolatimeus
Copy link
Contributor

Note: We are using the Conventional Commits convention for our pull request titles. Please take a look at the PR title format document for the supported types and scopes.

Brief description of the PR. [e.g. Added null check on object to avoid NullPointerException]

Changes the policy of the PositionProvider reference in the PositionService from static to dynamic.
Having the policy set as static causes the PositionService and all services that depend on it with a static reference (e.g. the CloudService) to be deactivated and reactivated whenever a PositionProvider is registered or unregistered, causing unnecessary service reactivations on startup and shutdown.
The fact that the CloudService is reactivated may cause the pubblication of spurious lifecycle messages.

Also fixes possible NPE thrown by getPosition(), getNmeaPosition() and isLocked() if called when the configured provider is not bound.

Signed-off-by: Nicola Timeus <nicola.timeus@eurotech.com>
@MMaiero MMaiero changed the title fix: Use dynamic policy for PositonProvider reference in PositionService fix: Use dynamic policy for PositionProvider reference in PositionService Nov 12, 2024
@mattdibi mattdibi requested review from mattdibi and removed request for salvatore-coppola November 12, 2024 15:44
@mattdibi
Copy link
Contributor

Tested in combination with: #5544. Startup time with active cloud connection went from 140 seconds to 53 seconds

@mattdibi mattdibi merged commit 72a2834 into eclipse-kura:develop Nov 12, 2024
5 checks passed
eclipse-kura-bot pushed a commit that referenced this pull request Nov 12, 2024
…vice (#5529)

fix: Use dynamic policy for PositonProvider reference in PositionService

Signed-off-by: Nicola Timeus <nicola.timeus@eurotech.com>
(cherry picked from commit 72a2834)
MMaiero pushed a commit that referenced this pull request Nov 13, 2024
…vice [backport release-5.6.0] (#5545)

fix: Use dynamic policy for PositionProvider reference in PositionService (#5529)

fix: Use dynamic policy for PositonProvider reference in PositionService

Signed-off-by: Nicola Timeus <nicola.timeus@eurotech.com>
(cherry picked from commit 72a2834)

Co-authored-by: nicolatimeus <nicola.timeus@eurotech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants